package net.obiam.droidz.model;
import net.obviam.droidz.MainThread;
import android.graphics.Bitmap;
import android.util.Log;
import android.graphics.Canvas;

public class Helicopter {
	private Bitmap bitmap;
	private float x;
	private float y;
	private boolean touched;
	private float velocity = 10;
	private static final String TAG = MainThread.class.getSimpleName();
	
	public Helicopter(Bitmap bitmap, float x, float y) {
		this.bitmap = bitmap;
		this.x = x;
		this.y = y;
	}
	public Bitmap getBitmap(){
		return bitmap;
	}
	public void setBitmap(Bitmap bitmap){
		this.bitmap = bitmap;
	}
	public float getX() {
		return x;
	}
	public void setX(float x) {
		this.x = x;
	}
	public float getY() {
		return y;
	}
	public void setY(float y) {
		this.y = y;
	}
	public boolean isTouched(){
		return touched;
	}
	public void setTouched(boolean touched){
		this.touched = touched;
	}
	public void draw(Canvas canvas){
		canvas.drawBitmap(bitmap, x - (bitmap.getWidth()/2), y - (bitmap.getHeight()/2), null);
	}
	public void move(){
		Log.d(TAG, "Moving");
		if(!touched){
			Log.d(TAG, "Going Down");
			if(y >= 0){
				y += 1.0/velocity;
			}
		}
		else{
			Log.d(TAG, "Going Up");
			if(y >= 0){
				y -= 2.0/velocity;
			}
		}
	}
}
